var t = getApp();

Page({
    data: {
        page: 0,
        prenumber: 12,
        moreBoo: !0,
        loadingBoo: !0
    },
    onLoad: function(a) {
        var i = this;
        this.setData({
            id: a.id,
            token: wx.getStorageSync("log")
        }), wx.showLoading({
            title: "加载中..."
        }), wx.request({
            url: t.globalData.dicc + "ad/get/actTheme",
            data: {
                id: this.data.id
            },
            success: function(t) {
                console.log(t), 200 == t.data.code && i.setData({
                    activityImg: t.data.data.activityImg.split("|")[1],
                    awardImg: t.data.data.activityImg.split("|")[2]
                });
            }
        }), this.list();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    getMore: function() {
        this.data.moreBoo && this.data.loadingBoo && (this.setData({
            loadingBoo: !1
        }), this.list());
    },
    lookFun: function(t) {
        this.data.bearList[t.target.dataset.index].lookFlag = !this.data.bearList[t.target.dataset.index].lookFlag, 
        this.setData({
            bearList: this.data.bearList
        });
    },
    previewImage: function(t) {
        var a = t.currentTarget.dataset.index, i = t.target.dataset.indextwo;
        wx.previewImage({
            current: this.data.bearList[a].estimateContentImgBig[i],
            urls: this.data.bearList[a].estimateContentImgBig
        });
    },
    list: function() {
        var a = this;
        wx.request({
            url: t.globalData.dicc + "public/activity/listActivity/" + this.data.page + "/" + this.data.prenumber + "/" + this.data.token,
            success: function(t) {
                console.log(t), wx.hideLoading(), 200 == t.data.code && (a.data.page <= 0 && (t.data.data.listBusinessActivityBbsTopicVO.forEach(function(t) {
                    t.lookFlag = !1;
                }), a.setData({
                    bearList: t.data.data.listBusinessActivityBbsTopicVO
                })), a.data.page > 0 && (t.data.data.listBusinessActivityBbsTopicVO.length > 0 ? t.data.data.listBusinessActivityBbsTopicVO.forEach(function(t) {
                    t.lookFlag = !1, a.data.bearList.push(t);
                }) : a.setData({
                    moreBoo: !1
                }), a.setData({
                    bearList: a.data.bearList,
                    loadingBoo: !0
                })), a.data.page++);
            }
        });
    }
});